<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of ccvAkmeansLookup</title>
  <meta name="keywords" content="ccvAkmeansLookup">
  <meta name="description" content="AKMEANS computes kmeans clustering on the input data using approximate">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../index.html">Home</a> &gt;  <a href="index.html">caltech-image-search</a> &gt; ccvAkmeansLookup.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for caltech-image-search&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->

<h1>ccvAkmeansLookup
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>AKMEANS computes kmeans clustering on the input data using approximate</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [ids, dists] = ccvAkmeansLookup(akmeans, searchdata) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> AKMEANS computes kmeans clustering on the input data using approximate
 nearest neighbors computed using randomized kd-trees

 Inputs:
 -------
 akmeans     - the input akmeans struct
 searchdata  - the input search data
 
 Outputs:
 --------
 ids         - the id of the closest mean to each input search point
 dists       - the distances to the closest mean

 See also <a href="ccvAkmeansCreate.html" class="code" title="function [akmeans] = ccvAkmeansCreate(data, k, maxiter, type, ntrees,varrange, meanrange, maxdepth, minvar, cycle, dist, maxbins,sample, mex, matlabout, seed, verbose)">CCVAKMEANSCREATE</a>, CCVKDTREECREATE, CCVKDTREELOOKUP</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="ccvKdtKnn.html" class="code" title="function [ids, dists] = ccvKdtKnn(kdt, kdtData, sData, k, tData)">ccvKdtKnn</a>	CCVKDTKNN searches the KD-Tree for the k-nearest neighbors for the input</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [ids, dists] = ccvAkmeansLookup(akmeans, searchdata)</a>
0002 <span class="comment">% AKMEANS computes kmeans clustering on the input data using approximate</span>
0003 <span class="comment">% nearest neighbors computed using randomized kd-trees</span>
0004 <span class="comment">%</span>
0005 <span class="comment">% Inputs:</span>
0006 <span class="comment">% -------</span>
0007 <span class="comment">% akmeans     - the input akmeans struct</span>
0008 <span class="comment">% searchdata  - the input search data</span>
0009 <span class="comment">%</span>
0010 <span class="comment">% Outputs:</span>
0011 <span class="comment">% --------</span>
0012 <span class="comment">% ids         - the id of the closest mean to each input search point</span>
0013 <span class="comment">% dists       - the distances to the closest mean</span>
0014 <span class="comment">%</span>
0015 <span class="comment">% See also CCVAKMEANSCREATE, CCVKDTREECREATE, CCVKDTREELOOKUP</span>
0016 <span class="comment">%</span>
0017 
0018 <span class="comment">% Author: Mohamed Aly &lt;malaa at vision d0t caltech d0t edu&gt;</span>
0019 <span class="comment">% Date: October 6, 2010</span>
0020 
0021 ids = [];
0022 dists = [];
0023 
0024 <span class="comment">%if empty return</span>
0025 <span class="keyword">if</span> isempty(searchdata), <span class="keyword">return</span>; <span class="keyword">end</span>;
0026 
0027 <span class="comment">%lookup in the kdtree of means</span>
0028 <span class="keyword">switch</span> akmeans.type
0029   <span class="keyword">case</span> <span class="string">'kdtree'</span>
0030     [ids, dists] = ccvKdtreeLookup(akmeans.kdt, akmeans.means, searchdata, 1);
0031   <span class="keyword">case</span> <span class="string">'kdt'</span>
0032     [ids, dists] = <a href="ccvKdtKnn.html" class="code" title="function [ids, dists] = ccvKdtKnn(kdt, kdtData, sData, k, tData)">ccvKdtKnn</a>(akmeans.kdt, akmeans.means, searchdata, 1);
0033 <span class="keyword">end</span>;
0034</pre></div>
<hr><address>Generated on Fri 05-Nov-2010 19:46:04 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>